﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SmartForm.Common
{
    public class Delay
    { 
        public static void DelaySecond(int second) //延迟系统时间，但系统又能同时能执行其它任务；
        {
            DateTime current = DateTime.Now;
            while (current.AddSeconds(second) > DateTime.Now)
            {
                Application.DoEvents();//转让控制权            
            }
            return;
        }
    }
}
